package com.sqx.modules.fiction.controller.app;

import com.sqx.common.utils.Result;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.fiction.service.FictionChapterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/app/fictionChapter")
public class AppFictionChapterController {
    @Autowired
    private FictionChapterService fictionChapterService;


    /**
     *
     * @param fictionId
     * @return
     */
    @GetMapping("/getChapterList/{fictionId}")
    public Result getChapterList(@PathVariable Long fictionId,Integer page,Integer limit){
        return fictionChapterService.getChapterList(fictionId,page,limit);
    }

    @Login
    @PostMapping("/deleteChapterById/{fictionChapterId}")
    public Result deleteChapterById(@PathVariable Long fictionChapterId){
        return fictionChapterService.deleteChapterById(fictionChapterId);
    }
}
